const MyPromise = require("./promise");
let p1 = new MyPromise((resolve, reject) => {
  setTimeout(() => {
    resolve("成功....1");
  }, 2000);
});
let p2 = new MyPromise((resolve, reject) => {
  setTimeout(() => {
    reject("失败....2");
  }, 2000);
});
MyPromise.all([p1, p2, "a", "b"])
  .then((r) => {
    console.log(r);
  })
  .catch((e) => {
    console.log(e);
  });
